package com.cy.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wxhn1
 */
@Configuration
@MapperScan("com.cy.mapper")
public class MybatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor pi() {
        MybatisPlusInterceptor m = new MybatisPlusInterceptor();
        PaginationInnerInterceptor pi = new PaginationInnerInterceptor();
        pi.setOverflow(true); // 分页合理化
        pi.setDbType(DbType.ORACLE);
        m.addInnerInterceptor(pi);
        return m;
    }
}
